package com.wissen.giskard.server.impl;

import org.hibernate.Query;
import org.hibernate.Session;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.wissen.giskard.client.services.AuthenticationService;
import com.wissen.giskard.server.UserValidation;
import com.wissen.giskard.server.domainobjects.User;

@SuppressWarnings("serial")

/*
 *    this class test whether user is valid or not
 */
public class AuthenticateServiceimpl  extends RemoteServiceServlet implements AuthenticationService {

	@Override
	public boolean authenticateUser(String userName, String password)
			throws IllegalArgumentException {
		boolean result=false;
		UserValidation userValidation = new UserValidation();
		User user=userValidation.validateUser(userName, password);
		if(user!=null)
			result=true;
		
		return result;
	}
}

